package com.ship.dispatch.bean.shipBusiness;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ship.common.core.base.BaseBean;
import com.ship.common.core.base.Joinable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sm_ship_report_record")
public class SmShipReportRecord extends BaseBean implements Joinable {

    /**
     * 船舶午报附件id
     */
    @TableField("ship_report_id")
    @ApiModelProperty(value = "船舶午报id")
    private Long shipReportId;

    /**
     * 操作类型（1：新增船舶午报，2：编辑船舶午报，3：删除船舶午报）
     */
    @TableField("operate_type")
    @ApiModelProperty(value = "操作类型（1：新增船舶午报，2：编辑船舶午报，3：删除船舶午报）")
    private Integer operateType;

    @TableField(exist = false)
    private String operateTypeStr;

    /**
     * 操作备注
     */
    @TableField("operate_remark")
    @ApiModelProperty(value = "操作备注")
    private String operateRemark;

    /**
     * 操作时间
     */
    @TableField("operate_time")
    @ApiModelProperty(value = "操作时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date operateTime;

    /**
     * 操作人
     */
    @TableField("operate_by")
    @ApiModelProperty(value = "操作人")
    private String operateBy;

    @Override
    public String getLabel() {
        return null;
    }

    @Override
    public String getValue() {
        return null;
    }

    public String getOperateTypeStr(){
        String result = "";
        if(null != getOperateType()){
            if(operateType.equals(1)){
                result = "新增船舶午报";
            }else if(operateType.equals(2)){
                result = "编辑船舶午报";
            }else if(operateType.equals(3)){
                result = "删除船舶午报";
            }
        }
        return result;
    }
}
